]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Disconnect from 'prepare-for-sleep' signal
authorRui Matos <tiagomatos@gmail.com>
Mon, 30 Jan 2017 12:29:13 +0000 (13:29 +0100)
committerRui Matos <tiagomatos@gmail.com>
Tue, 31 Jan 2017 12:53:26 +0000 (13:53 +0100)
This signal connection was keeping Background instances from being
garbage collected.

https://bugzilla.gnome.org/show_bug.cgi?id=777934

js/ui/background.js

index 9b36029648ee263a14e8ac824576940edb1ba666..fc27898105123e9f35d221b270508ecc43cae686 100644 (file)
@@ -254,7 +254,8 @@ const Background = new Lang.Class({
                     this._loadAnimation(this._animation.file);
             }));
 
-        LoginManager.getLoginManager().connect('prepare-for-sleep',
+        let loginManager = LoginManager.getLoginManager();
+        this._prepareForSleepId = loginManager.connect('prepare-for-sleep',
             (lm, aboutToSuspend) => {
                 if (aboutToSuspend)
                     return;
@@ -283,6 +284,10 @@ const Background = new Lang.Class({
             this._clock.disconnect(this._timezoneChangedId);
         this._timezoneChangedId = 0;
 
+        if (this._prepareForSleepId != 0)
+            LoginManager.getLoginManager().disconnect(this._prepareForSleepId);
+        this._prepareForSleepId = 0;
+
         if (this._settingsChangedSignalId != 0)
             this._settings.disconnect(this._settingsChangedSignalId);
         this._settingsChangedSignalId = 0;